import request from "./config";

export const getTypeList = () => {
  return request({
    url: "/api/types/all",
    method: "get",
  });
};

export const addType = (data) => {
  return request({
    url: "/api/types/add",
    method: "post",
    params: data,
  });
};

export const updateType = (id, data) => {
  return request({
    url: `/api/types/${id}`,
    method: "put",
    data,
  });
};

export const deleteType = (id) => {
  return request({
    url: `/api/types/${id}`,
    method: "delete",
  });
};
